package com.xuecheng.api.client.fallback;

import com.xuecheng.api.client.CheckcodeClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * @author 勾新杰
 * @version 1.0
 * @description:
 * @date 2025/2/22 16:28
 */
@Slf4j
public class CheckcodeClientFallBackFactory implements FallbackFactory<CheckcodeClient> {
    @Override
    public CheckcodeClient create(Throwable throwable) {
        return new CheckcodeClient() {
            @Override
            public Boolean verify(String key, String code) {
                log.error("校验验证码失败，降级逻辑触发");
                return false;
            }
        };
    }
}
